package com.springBoot.springBootSysCore.modules.services.system;

import com.springBoot.springBootSysCore.common.service.IBaseService;
import com.springBoot.springBootSysCore.modules.entity.system.SysUser;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.ui.Model;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 用户接口
 * @author timo
 *
 */
public interface SysUserService extends IBaseService<SysUser, String> {
	/**
	 * 登录
	 * @param sysUser
	 * @param validCode
	 * @param model
	 * @param piccode
	 * @return
	 */
	public String userLogin(SysUser sysUser, String validCode, Model model, Object piccode, Boolean rememberMe);
	/**
	 * 保存
	 * @param roleIds 角色id集合 (eg:{ids:[1,2,3,4,5]})
	 * @return
	 */
	public Map<String,Object>  saveSysUser(SysUser sysUser, String roleIds, String orgIds) throws Exception;
	/**
	 * 删除
	 * @param asList id集合
	 * @return
	 */
	public Map<String,Object> deletes(List<String> asList);

	public Map<String,Object> delete(SysUser user);
	/**
	 * 根据Id集合查询
	 * @author PSC
	 * @param ids
	 * @return
	 */
	public List<SysUser> findByIds(List<String> ids);
	/**
	 * 根据account值或者realName值查询Id集合(like查询)
	 * @author PSC
	 * @param queryInfo
	 * @return
	 */
	public List<String> findAllIdsByAccountOrRealNamr(String queryInfo);
	
	/**
	 * 重置用户密码
	 * @param userIds
	 * @return
	 */
	public Map<String,Object> resetUserPassWord(List<String> userIds);
	
	/**
	 * 当前登录用户修改自己的密码
	 * @param oldPassword 旧密码
	 * @param newPassword 新密码
	 * @param piccode 验证码
	 * @param validCode 新验证码
	 * @return
	 */
	public Map<String,Object> changeUserPassword(String oldPassword, String newPassword, Model model, Object piccode, String validCode);

	/**
	 * 检查用户名
	 * @param account
	 * @param id
	 * @return
	 */
	public Object checkUserName(String account, String id);

	/**
	 * 根据id修改用户状态
	 * @return
	 */
	public Map<String,Object> updateStateById(String id,String available);

	/**
	 * 根据id重置用户密码
	 * @param id
	 * @param password
	 * @return
	 */
	public Map<String,Object> resetLoginPwd(String id, String password);

	/**
	 * 根据类型查询select的数据
	 * @param userType
	 * @return
	 */
	public List<Map<String, Object>> findSelect(String userType);

    void memberPayOk(HttpServletRequest request, HttpServletResponse response);
}
